package vns.client.event;

import vns.shared.ObjectTypeDTO;

import com.google.gwt.event.shared.GwtEvent;

public class ObjectTypeEditEvent extends GwtEvent<ObjectTypeEditEventHandler> {

	public static Type<ObjectTypeEditEventHandler> TYPE = new Type<ObjectTypeEditEventHandler>();

	private ObjectTypeDTO objectTypeDTO;

	public ObjectTypeEditEvent(ObjectTypeDTO objectTypeDTO) {
		this.setObjectTypeDTO(objectTypeDTO);
	}

	@Override
	public Type<ObjectTypeEditEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ObjectTypeEditEventHandler handler) {
		handler.onEditObjectType(this);
	}

	public void setObjectTypeDTO(ObjectTypeDTO objectTypeId) {
		this.objectTypeDTO = objectTypeId;
	}

	public ObjectTypeDTO getObjectTypeDTO() {
		return objectTypeDTO;
	}
}
